package cn.com.open.itembank.service;

import cn.com.open.itembank.dto.ItemBankCount;
import cn.com.open.itembank.entity.CourseItemBank;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Created by lucky on 2017/9/5.
 */
@FeignClient(name = "item-base-service")
public interface AppRemoteService {
    /**
     * 获取appKey列表
     *
     * @return appKey列表
     */
    @GetMapping(value = "/app")
    List<String> getAppList();

    /**
     * 根据appKey和orgid获取课程题库信息
     *
     * @param appKey 应用ID
     * @param orgId  机构ID
     * @return 可用题库列表
     */
    @GetMapping(value = "/app/{appKey}/org/{orgId}/itembanks")
    List<CourseItemBank> getItembankListByAppKeyAndOrgId(@PathVariable(value = "appKey") String appKey, @PathVariable(value = "orgId") String orgId);

    /**
     * 根据appKey获取对应题库题量列表
     *
     * @param appKey 应用ID
     * @return 有效的题库题量列表
     */
    @GetMapping(value = "/app/{appKey}/itembank/questioncount")
    List<ItemBankCount> getItembankQuestionCountByAppKey(@PathVariable(value = "appKey") String appKey);
}
